Optimize C++ performance by transferring resources via move constructors instead of copying them to reduce memory overhead.